/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@mixin nb-calendar-theme() {

  nb-base-calendar {
    nb-card {
      overflow: hidden;
    }

    &.medium nb-card {
      width: nb-theme(calendar-width);

      nb-card-body {
        height: nb-theme(calendar-body-height);
      }
    }

    &.large nb-card {
      width: nb-theme(calendar-large-width);

      nb-card-body {
        height: nb-theme(calendar-large-body-height);
      }
    }

    &.has-week-number.medium nb-card {
      width: calc(#{nb-theme(calendar-width)} + #{nb-theme(calendar-day-cell-width)} + 1px);
    }

    &.has-week-number.large nb-card {
      width: calc(#{nb-theme(calendar-large-width)} + #{nb-theme(calendar-day-cell-width)} + 1px);
    }

    nb-card {
      border: none;
      margin: 0;
    }

    nb-card-body {
      padding: 0;

      & > nb-calendar-pageable-navigation, & > nb-calendar-navigation {
        padding: 1rem 0;
      }
    }
  }

  nb-calendar-day-picker .range-cell {
    flex: 1;
    margin: 1px 0;

    .day-cell {
      margin: 0;
    }

    &.in-range {
      background: nb-theme(calendar-cell-in-range-background-color);

      &:not(.today, :hover) {
        border-radius: 0;
      }
    }

    &.start, &.end {
      @extend .selected;
      background: nb-theme(calendar-cell-in-range-background-color);
    }

    &.start {
      border-top-left-radius: nb-theme(calendar-border-radius);
      border-bottom-left-radius: nb-theme(calendar-border-radius);

      .day-cell {
        margin-left: 0;
      }
    }

    &.end {
      border-top-right-radius: nb-theme(calendar-border-radius);
      border-bottom-right-radius: nb-theme(calendar-border-radius);

      .day-cell {
        margin-right: 0;
      }
    }

    &:first-of-type {
      border-top-left-radius: nb-theme(calendar-border-radius);
      border-bottom-left-radius: nb-theme(calendar-border-radius);
    }

    &:last-of-type {
      border-top-right-radius: nb-theme(calendar-border-radius);
      border-bottom-right-radius: nb-theme(calendar-border-radius);
    }
  }
}
